﻿sealed class ExampleA : ZXthex.FromC
{
    public delegate float AddFunction(float v1, float v2);

    AddFunction func;

    /// <summary>
    /// 
    /// #include "stdafx.h"
    ///
    /// EXTERN_C{
    ///
    ///	    __declspec(dllexport)  float addx(float value1, float value2)
    ///     {
    ///
    ///         return value1 + value2;
    ///     }
    /// }
    ///
    /// </summary>
    public ExampleA() : base(@"dlls/Dll1x.dll")
    {
        func = GetFunction<AddFunction>("addx");
    }

    public float Add(float v1, float v2)
    {
        return  func.Invoke(v1, v2);
    }
}